package com.ymk.service.impl;

import com.ymk.base.mybatis.DaoRouter;
import com.ymk.base.mybatis.Pagination;
import com.ymk.bo.orders.OrdersItemBO;
import com.ymk.service.IOrdersItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/**
 * <p>
 * 订单商品表 服务实现类
 * </p>
 *
 * @author 莫参商
 * @since 2023-05-05
 */
@Service
public class OrdersItemService implements IOrdersItemService {

    @Override
    public OrdersItemBO get(Map param) {
    return this.daoRouter.queryForObject("OrdersItem.loadOrdersItem",param);
    }

    @Override
    public List<OrdersItemBO> list(Map param) {
        return this.daoRouter.query("OrdersItem.loadOrdersItem",param);
    }

    @Override
    public List<OrdersItemBO> listForPage(Pagination pagination) {
        return this.daoRouter.query("OrdersItem.loadOrdersItemForPage",pagination);
    }

    @Override
    public void post(OrdersItemBO param) {
        this.daoRouter.insert("AOrdersItem.insertOrdersItem",param);
    }

    @Override
    public void postList(List<OrdersItemBO> ordersItemBOList) {
        this.daoRouter.insert("AOrdersItem.insertOrdersItemList",ordersItemBOList);
    }

    @Override
    public void update(OrdersItemBO param) {
        this.daoRouter.update("AOrdersItem.updateOrdersItem",param);
    }

    @Override
    public void del(OrdersItemBO param) {
        this.daoRouter.update("AOrdersItem.delOrdersItem",param);
    }

    @Autowired
    private DaoRouter daoRouter;

}
